package com.jdyfy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jdyfy.entity.RoleMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMenuMapper extends BaseMapper<RoleMenu> {

    //根据角色id删除角色菜单
    @Delete("delete from role_menu where role_id = #{roleId}")
    int deleteRoleId(@Param("roleId") Long roleId);

    //根据角色id查询菜单id
    @Select("select menu_id from role_menu where role_id = #{roleId}")
    List<Long> selectByRoleId(Long roleId);
}
